package leet.ku._119;

import java.util.ArrayList;
import java.util.List;

public class Solution {
    public List<Integer> getRow(int rowIndex) {
    	List<Integer> ans = new ArrayList<Integer>();
    	if (rowIndex < 0)
    		return ans;
    	
    	int[] result = new int[rowIndex + 1];
    	result[0] = 1;
    	for (int i = 1; i <= rowIndex; i++)
    		for (int j = i; j >= 1; j--)
    			result[j] += result[j - 1];
    	for (int n : result)
    		ans.add(n);
    	return ans;
    }
}